import 'package:flutter/material.dart';
import 'package:material_design_practice1/custom_widget.dart';

class Page2 extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    return Page2State();
  }

}

class Page2State extends State{
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          backgroundColor: Colors.transparent,
          shape: Border(bottom: BorderSide(color: Colors.black12)),
          elevation: 0,
          titleSpacing: 0,
          leading: Icon(Icons.menu,color: Colors.black54,size: 28,),
          title: Text(
            "Google Classroom",
            style: TextStyle(
                fontSize: 22,
                color: Colors.black54
            ),
          ),
          actions: <Widget>[
            IconButton(
              icon: Icon(Icons.add,color: Colors.black54,size: 28,),
              onPressed: (){},
            ),
            PopupMenuButton(
              icon: Icon(Icons.more_vert,color: Colors.black54,size: 28,),
              itemBuilder: (context) => <PopupMenuItem>[
                
              ],
            )
          ],
        ),
        body: Container(
          child: ListView(
            children: <Widget>[
              Container(
                margin: EdgeInsets.all(16),
                child: CourseCard("Astronomy", "Peroid 1", "Mr Zhao", "images/astronomy.jpg"),
              ),
              Container(
                margin: EdgeInsets.fromLTRB(16, 0, 16, 16),
                child: CourseCard("Chemistry", "Peroid 3", "Mr Qian", "images/chemistry.jpg"),
              ),
              Container(
                margin: EdgeInsets.fromLTRB(16, 0, 16, 16),
                child: CourseCard("Environment", "Peroid 3", "Mr Sun", "images/environment.jpg"),
              ),Container(
                margin: EdgeInsets.fromLTRB(16, 0, 16, 16),
                child: CourseCard("Football", "Peroid 2", "Mr Li", "images/football.jpg"),
              ),
              Container(
                margin: EdgeInsets.fromLTRB(16, 0, 16, 16),
                child: CourseCard("Computer", "Peroid 2", "Mr Zhou", "images/computer.jpg"),
              ),
              Container(
                margin: EdgeInsets.fromLTRB(16, 0, 16, 16),
                child: CourseCard("Biology.jpg", "Peroid 4", "Mr Wu", "images/biology.jpg"),
              )
            ],
          ),
        ),
      ),
    );
  }

}